(Ankabooth ) 29 : 38
وَعَادًا وَثَمُودَ وَقَدْ تَبَيَّنَ لَكُمْ مِنْ مَسَاكِنِهِمْ ۖ وَزَيَّنَ لَهُمُ الشَّيْطَانُ أَعْمَالَهُمْ فَصَدَّهُمْ عَنِ السَّبِيلِ وَكَانُوا مُسْتَبْصِرِينَ
And ʿAad and Thamud, and it has become clear to you from their dwellings, and Satan had made pleasing to them their deeds and averted them from the Straightpath, and they were having perception.
“They were having perception,” told in this verse means Aad and Thamud had enough knowledge and strength for worldly gains. But by rejecting their Messengers and Adhikr, Satan had made them attractive their aimless deeds. See explanation 3: 138; 6: 112 and 27: 24.